package review

import org.apache.spark.rdd.RDD
import org.apache.spark.{SparkConf, SparkContext}

object Test01 {
  def main(args: Array[String]): Unit = {

    val context = new SparkContext(new SparkConf().setMaster("local[*]").setAppName("review"))

    val data: RDD[Int] = context.makeRDD(List(1, 2, 3, 4, 5, 6, 7, 8, 9, 10))
    val rdd1: RDD[Int] = data.mapPartitions(
      datas => {
        datas.filter(_ > 5)
      }
    )
    rdd1.foreach(println(_))

    context.stop()
  }

}
